# Makefile
#
# Created on: Dec 12, 2008
#     Author: michael
###############################

.SUFFIXES:.c

INCLUDE=include

CC=cc
CFLAG=-O -DUNIX -DLIB -DDEBUG -DTRACE_FILE='"./trace.log"' 
EDF=

comlib:libsrc/debug libsrc/file libsrc/time libsrc/pid libsrc/msg  \
libsrc/sem libsrc/shm libsrc/str libsrc/tcp libsrc/udp libsrc/config

.c:
	if [ -f lib/libcom.a ]; then ar -x lib/libcom.a; fi
	$(CC) -c $< $(CFLAG) 
	ar -rv libcom.a *.o
	ranlib libcom.a
	rm -rf *.o
	mv libcom.a lib
	sudo cp include/comlib.h /usr/include
	
clean:
	rm -rf *.o
	rm -rf ./Debug
	rm -rf lib/*.a